﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Comics.Model
{
    public sealed class Member
    {
        public Member() { }

        public Guid ID { get; set; }
        public string Email { get; set; }
        public string UserName { get; set; }
        public string FirstName { get; set; }
        public string LastName { get; set; }
        public DateTime JoinDate { get; set; }
        public DateTime LastLoginDate { get; set; }
        public string Password { get; set; }
        public string APIKey { get; set; }

        public static Member AuthenticateMember(string email, string password)
        {
            return Services.Service.Provider.GetMember(email, password);
        }

        public static void Save(Member member)
        {
            Services.Service.Provider.UpdateMember(member);
        }

        public static void Delete(Member member)
        {
            Services.Service.Provider.DeleteMember(member);
        }
    }
}
